package com.bilubi.reggie.reggie.mapper;

import com.bilubi.reggie.reggie.annotation.AutoFill;
import com.bilubi.reggie.reggie.bean.Employee;
import com.bilubi.reggie.reggie.enums.OperateType;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface EmployeeMapper {

    Employee getEmployeeByUsername(Employee employee);

    Employee getEmployeeById(Long id);

    List<Employee> getAllEmployees(String name);

    @AutoFill(value = OperateType.INSERT)
    Integer addEmployee(Employee employee);

    @AutoFill(value = OperateType.UPDATE)
    Integer updateEmployee(Employee employee);

}